var express = require('express');

var app = new express();


// 使用静态方法解析 /public 路由
app.use("/public", express.static(__dirname + '/server/public'));
// 使用引用文件解析路由
app.use('/user', require('./server/routes/users'));
app.use('/product', require('./server/routes/products'));
app.use('/', require('./server/routes/main'));

// 启动侦听服务
app.listen(8001,function(err){
    if(err){
        console.log('Server is not runed !');
    }else{
        console.log('Server is runing !');
    }
});